/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PicJFrame.java
 *
 * Created on 16.05.2011, 12:16:19
 */

package ru.ipo.dces.editors.expressolymp;

/**
 *
 * @author push_king
 */
public class PicJFrame extends javax.swing.JFrame {

    /** Creates new form PicJFrame */
    public PicJFrame() {
        initComponents();
    }

    public PicJFrame(Predicate pred) {
        initComponents();
        jLabelPic.setIcon(pred.image);
        this.setTitle(pred.name);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelPic = new javax.swing.JLabel();

        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setFocusable(false);
        setFocusableWindowState(false);
        setIconImages(null);
        setMinimumSize(new java.awt.Dimension(640, 640));
        setName("Form"); // NOI18N
        setResizable(false);

        jLabelPic.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(ru.ipo.dces.editors.expressolymp.ExpressOlympApp.class).getContext().getResourceMap(PicJFrame.class);
        jLabelPic.setIcon(resourceMap.getIcon("jLabelPic.icon")); // NOI18N
        jLabelPic.setText(resourceMap.getString("jLabelPic.text")); // NOI18N
        jLabelPic.setAlignmentY(0.0F);
        jLabelPic.setFocusable(false);
        jLabelPic.setIconTextGap(0);
        jLabelPic.setInheritsPopupMenu(false);
        jLabelPic.setName("jLabelPic"); // NOI18N
        jLabelPic.setRequestFocusEnabled(false);
        jLabelPic.setVerifyInputWhenFocusTarget(false);
        jLabelPic.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelPicMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabelPic, javax.swing.GroupLayout.PREFERRED_SIZE, 640, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabelPic, javax.swing.GroupLayout.PREFERRED_SIZE, 640, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabelPic.getAccessibleContext().setAccessibleName(resourceMap.getString("jLabelPic.AccessibleContext.accessibleName")); // NOI18N

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jLabelPicMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelPicMouseClicked
        this.setVisible(false);
    }//GEN-LAST:event_jLabelPicMouseClicked

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PicJFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabelPic;
    // End of variables declaration//GEN-END:variables

}
